<?php

namespace app\admin\validate;

use think\Validate;
use app\common\Error;

class VideoDetail extends Validate
{
    protected $rule = [
        'video_id' => 'require',
        'id' => 'require',
        'name' => 'require',
        'url' => 'require',
        'is_members' => 'require',
        'data' => 'require',
        'pay_amount' => 'require',
        'sort' => 'require',
        'id_string' => 'require',
    ];

    protected $message = [
        'video_id.require' => Error::VIDEO_ID_NOT_EXIXTS,
        'id.require' => Error::ID_NOT_EXIXTS,
        'name.require' => Error::NAME_NOT_EXIXTS,
        'url.require' => Error::URL_NOT_EXIXTS,
        'is_members.require' => Error::IS_MEMBERS_NOT_EXIXTS,
        'data.require' => Error::DATA_NOT_EXIXTS,
        'pay_amount.require' => Error::PAY_AMOUNT_NOT_EXIXTS,
        'sort.require' => Error::SORT_NOT_EXIXTS,
        'id_string.require' => Error::ID_STRING_NOT_EXIXTS,
    ];

    protected $scene = [
        'list' => ['video_id'],
        'add' => ['name', 'video_id', 'is_members', 'url', 'sort'],
        'edit' => ['id', 'name', 'video_id', 'is_members', 'url', 'sort'],
        'delete' => ['id'],
        'detail' => ['id'],
        'set_charge' => ['video_id', 'sort', 'pay_amount'],
        'cancel_charge' => ['video_id', 'sort'],
        'batch_upload' => ['data'],
        'batch_delete' => ['id_string'],
    ];
}